<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('goods/index')}">商品列表</a></li>
        <li><a href="{:url('goods/add')}">添加商品</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('goods/index')}">
        商品名称:
        <input type="text" class="form-control" name="name" value="{:input('request.name/s','')}" placeholder="请输入商品名称">
        状态:
        <select name="status" class="form-control">
            <option value="0">--全部--</option>
            <option <if condition="isset($status) && $status eq '1'"> selected </if> value="1">--上架--</option>
            <option <if condition="isset($status) && $status eq '2'"> selected </if> value="2">--下架--</option>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('goods/index')}">清空</a>
    </form>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th>ID</th>
                <th>商品名称</th>
                <th>商品图片</th>
                <th>现价</th>
                <th>原价</th>
                <th>销量</th>
                <th>规格1</th>
                <th>规格2</th>
                <th>是否首页推荐</th>
                <th>分类</th>
                <th>状态</th>
                <th>添加时间</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="goods" item="vo">
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.name}</td>
                    <td><img style="width:50px;height:50px;" src="{$vo['img']}" alt=""></td>
                    <td>{$vo.price}</td>
                    <td>{$vo.old_price}</td>
                    <td>{$vo.sales}</td>
                    <td>{$vo.para}</td>
                    <td>{$vo.para1}</td>
                    <td>{$vo['is_public'] == 1 ? '不推荐' : '推荐'}</td>
                    <th>{$vo.title}</th>
                    <th>{$vo['status'] == 1 ? '正常' : '下架'}</th>
                    <td>{$vo.addtime|substr=0,10}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('goods/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                        <a class="btn btn-xs btn-danger" href="{:url('goods/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">
                            {:lang('DELETE')}
                        </a>
                        <if condition="$vo['status'] neq 2">
                        <a class="btn btn-xs btn-info" href="{:url('goods/update',array('id'=>$vo['id']))}">
                            下架
                        </a>
                        </if>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page|default=''}</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>